package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.*;

@Getter
@AllArgsConstructor
public enum VideoEventEnum {
//    final String base_url = "http://192.168.100.13:38080";
    SUBSCRIBE_EVENT(0, "订阅事件", "/api/eventService/v1/eventSubscriptionByEventTypes"),

    YANWU_EVENT(192513, "烟雾检测", "/receive/video/event/yanwujiance"),
    QUYURUQIN_EVENT(131588, "区域入侵", "/receive/video/event/quyuruqin"),
    HUODIAN_EVENT(192515, "火点检测", "/receive/video/event/huodianjiance"),
    RENYUANJUJI_EVENT(131593, "人员聚集", "/receive/video/event/renyuanjuji"),
    FANYUEZHALAN_EVENT(131585, "越界侦测", "/receive/video/event/yuejiezhence");


    private final int code;
    private final String desc;
    private final String url;

    public static String urlOfCode(int code) {
        VideoEventEnum video = Arrays.stream(values()).filter(status -> status.getCode()==code).findFirst().orElse(null);
        return video!=null ? video.getUrl() : "";
    }

//    public static List<HashMap<String, Object>> getAllList() {
//        List<HashMap<String, Object>> list = new ArrayList<>();
//        for (VideoEventEnum jobTypeEnum : EnumSet.allOf(VideoEventEnum.class)) {
//            HashMap<String, Object> map = new HashMap<>();
//            map.put("name", jobTypeEnum.desc);
//            map.put("code", jobTypeEnum.code);
//            list.add(map);
//        }
//        return list;
//    }

}
